
# projectPath=`pwd`

# #配置， 在linux下运行
# imageName="platform"
# imageNameAll="ljl2docker/"${imageName}
# tag="v2.0"
# imageFile='platform_v2.0.tar'		#镜像文件名
# echo "默认配置本地镜像文件：${imageFile}"

# containerName=${imageName}_${tag}_thermal
# echo containerName: ${containerName}

# imgSaveMount="/home/recvImg"	#接收图片目录
# echo "挂载图片存储的路径, 默认：${imgSaveMount}"

# #read -p "请输入镜像名称(默认pytorch_dev)：" imageName
# if [ "${imageName}" = "" ];then
#         echo "imageName is ''"
# 		exit 0
# fi

# #read -p "请输入镜像tag(默认latest)：" tag
# if [ "${tag}" = "" ];then
# 		echo "tag is ''"
# 		exit 0
# fi

# #判断该路径是否存在
# if [ -d "${imgSaveMount}" ];then
# 	echo "${imgSaveMount}"存在
# else
# 	mkdir -p ${imgSaveMount}
# 	chmod 777 ${imgSaveMount}
# 	echo "创建挂载目录"
# fi
# ##配置结束



# isImage=`docker images |grep ${imageName} |grep ${tag}`
# isContainerName=`docker ps -a |grep ${containerName}`
# isExit=`docker ps -a |grep ${containerName} |grep 'Exited'`

# imageName=${imageNameAll}:${tag}
# echo imageName: ${imageName}

# if [ "${isContainerName}" = "" ];then
# 	#容器不存在
# 	echo '容器不存在, 检测镜像'
# 	if [ "${isImage}" = "" ];then
# 		#image不存在
# 		echo '镜像不存在'
# 		if [ -f "./${imageFile}" ];then
# 			echo "镜像文件存在， 开始导入镜像"
# 			#docker import - ${imageName} < ${imageFile}
# 			docker load < ${imageFile}
# 			echo "导入镜像成功, 镜像：" ${imageName}
			
# 		else
# 			echo "镜像文件不存在，请检查镜像文件" ${imageFile}
# 			exit 0
# 		fi
# 	else
# 		echo "镜像存在: " ${imageName}
# 	fi
# 	#image存在, 创建容器
# 	echo "创建新容器：" ${containerName}
# 	#docker run -it --rm --name ${containerName}  -v ${projectPath}/:/home/workSpace -v /${imgSaveMount}/:${imgSaveMount}/ ${imageName} /bin/bash -c "cd /home/workSpace/ji_fang_demo/ && /bin/bash"  &&
# 	# --gpus all

# 	#docker run -it -p 8989:8989  --name ${containerName}  -v ${projectPath}/:/home/workspace -v /etc/localtime:/etc/localtime ${imageName}  /bin/bash
# 	docker run -it  --net=host --name ${containerName}  -v ${projectPath}/:/home/workspace -v /etc/localtime:/etc/localtime ${imageName}  \
# 	/bin/bash -c "cd ./build && /bin/bash"
# 	echo "end ..."
	
# else 
# 	if [ "${isExit}" = "" ];then
# 		#容器不存在, 正在运行
# 		echo "容器存在, 且正在运行, 进入"
# 		docker exec -it ${containerName} bash -c "cd ./build && /bin/bash"
# 	else  
# 		#容器存在, 但已停止
# 		echo "容器存在, 已停止, 打开,并进入"
# 		docker start ${containerName}
# 		docker exec -it ${containerName} bash -c "cd ./build && /bin/bash"
# 	fi
	
# fi



# #docker run -it --rm --name ${containerName}  -v ${projectPath}/:/home/workSpace ${imageName} /bin/bash -C "/home/workSpace/containerAutoStart.sh"

# #sudo apt update
# #pip install pyyaml
# #pip install matplotlib
# #pip install seaborn





